﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using TCKQKL.Service.LookupClient;
using TCKQKL.FrontEnd.DataModel;

namespace TCKQKL.FrontEnd.Web.Controls
{
    public partial class Quotes : System.Web.UI.UserControl
    {
        public string StockSymbol = "";
        public UpdatePanelUpdateMode UpdateMode
        {
            set { this.pnlStocksInfo.UpdateMode = value; }
            get { return this.pnlStocksInfo.UpdateMode; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //             else
            //                 Label1.Text = "Không có mã này";

        }
        public void Update()
        {
            LSClient client = new LSClient();
            StocksInfoUI stk = client.GetStockDetail(StockSymbol.ToUpper());
            if (stk != null)
            {
                lblCompanyName.Text = stk.CompanyName;
                lblCeiling.Text = stk.Ceiling.ToString();
                lblFloor.Text = stk.Floor.ToString();
                lblRef.Text = stk.Ref.ToString();
                lblHigh.Text = stk.High.ToString();
                lblLow.Text = stk.Low.ToString();
                lblVolume.Text = (stk.Volume * 10).ToString("N0");
            }
            client.Close();
            this.pnlStocksInfo.Update();
        }
    }
}